#ifndef TCP_SERVER_H
#define TCP_SERVER_H

#include <QObject>
#include <QWidget>
#include <QTcpServer>
#include <QString>
#include <QTcpSocket>
#include <QHostAddress>
#include <QByteArray>
class tcp_server : public QWidget
{
    Q_OBJECT
public:
    explicit tcp_server(QWidget *parent = nullptr);

protected:
    QTcpServer server;
    QTcpSocket * Socket;

    QString Msg;
public:
    void listen(quint16 port);


signals:
    // 接收数据信号
    void recv_sig(QString msg);
};

#endif // TCP_SERVER_H
